<?php
if (! defined ( 'BASEPATH' )) exit ( 'No direct script access allowed' );
/**
 * ArrayChange class
 *
 * @version : 1.2.0
 * @author : MISS Long 2015-5-5
 *         默认使用AmazeUI样式命名
 *
 */
class ArrayChange{
	/*
	 * 把三维数组转化为二维数组
	 */
	public function thereToTwoArr($Arr)
	{
		$resultArr = array();
		$i = 0;
		foreach($Arr as $key => $value)
		{
			if(!empty($value))
			{
				foreach($value as $key1 => $value1)
				{
					if(!empty($value1))
					{
						$resultArr[$i] = $value1;
						$i++;
					}
				}
			}
		}
		return $resultArr;
	}
	/*
	 * 数组分页函数
	 */
	public function ArrayPage($arr=array(),$page = 1, $num = 10)
	{
		if ($page == 0) $page = 1;
		$offset = ($page - 1) * $num;
		$result = array_slice($arr,$offset,$num);
		return $result;
	}
	
}